package com.mkz.storage.feign.factory;

import org.springframework.stereotype.Component;

import com.mkz.storage.feign.StorageClient;
import com.mkz.storage.feign.fallback.StorageClientFallback;

import feign.hystrix.FallbackFactory;

@Component
public class StorageClientFallbackFactory implements FallbackFactory<StorageClient> {

	@Override
	public StorageClient create(Throwable throwable) {
		StorageClientFallback storageClientFallback = new StorageClientFallback();
		storageClientFallback.setCause(throwable);
		return storageClientFallback;
	}
}
